package com.cgy.utils.base.policy.handler;

import com.github.rholder.retry.Attempt;

/**
 * @author CH
 */
public interface IStrategyPolicy<T> {
    /**
     * 尝试策略
     * @return
     */
    public T policy();

    /**
     * 失败策略
     * @param throwable 异常
     * @return
     */
    public T failure(Throwable throwable);

    /**
     * 重试原因
     * @param attempt
     * @param <V>
     */
    <V> void message(Attempt<V> attempt);
}
